<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page session="true"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<h1>
	Hello world!  
</h1>
<form:form action="user" commandName="userlogin" class="navbar-form" >
        <div class="form-group">
          <form:input path="userName" class="form-control" placeholder="username" />
          <form:input path="password" class="form-control" placeholder="password" />     
        </div>
        <button type="submit" class="btn btn-default">Sign In</button>
      </form:form>
<P>  Hi ${user.result}! </P>
Hi ${sessionScope.userName}!


   <ul class="nav navbar-nav">
          <li><h4>Welcome to FreshDirect!</h4></li>	
      </ul>
      <c:choose>
      <c:when test="${not empty sessionScope.userName}">
        <ul class="nav navbar-nav navbar-right">
          <li><div class="navbar-form">
              <button type="button" class="btn btn-default">My Cart&nbsp;<span class="badge">4</span></button>
              </div></li>
          <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">${sessionScope.userName}<span class="caret"></span></a>
              <ul class="dropdown-menu" role="menu">
                <li><a href="#">My Account</a></li>
                <li><a href="#">My orders</a></li>
                <li class="divider"></li>
                <li><a href="#">Sign Out</a></li>
              </ul>
            </li>
      </ul>
        </c:when>
      <c:otherwise >
      <ul class="nav navbar-nav navbar-right">
      <li>
      <div class="navbar-form ">
      <a href="signup" type="submit" class="btn btn-primary">Sign Up</a>
      </div>
      </li>
      <li>
      <form class="navbar-form " role="signin">
        <div class="form-group">
          <input type="text" class="form-control" placeholder="username">
          <input type="password" class="form-control" placeholder="password">     
        </div>
        <button type="submit" class="btn btn-default">Sign In</button>
      </form>
      </li>
      </ul>
      </c:otherwise>
      </c:choose>
</body>
</html>